![]() |
MPRemoteCall |
||||
Header: | Multiprocessing.h | Carbon status: | Supported | |
Calls a nonreentrant function and blocks the current task.
void *MPRemoteCall ( MPRemoteProcedure remoteProc, void *parameter, MPRemoteContext context );
A pointer to the application-defined function you want to call. See MPRemoteProcedure for more information about the form of this function.
A pointer to a parameter to pass to the application-defined function. For example, this value could point to a data structure or a memory location.
The contexts (that is processes) that are allowed to execute the function. See
You use this function primarily to indirectly execute Mac OS system software functions. The task making the remote call is blocked until the call completes. The amount of time taken to schedule the remote procedure depends on the choice of the designated operating context. Specifying kMPAnyRemoteContext offers the lowest latency, but the called procedure may not have access to process-specific resources such as some low-memory values. Specifying kMPOwningProcessRemoteContext has higher latency because the remote procedure is deferred until the owning process becomes active. However, the remote procedure is guaranteed to execute within the owning process.
Note that with the exception of functions in Multiprocessing Services, you cannot safely call most system software functions directly from a preemptive task. Even if some system software function appears to work today when called from a preemptive task, unless explicitly stated otherwise there is no guarantee that subsequent versions of the same function will continue to work in future versions of system software. In Mac OS 8 implementations of Multiprocessing Services, the only exceptions to this rule are the atomic memory operations (such as AddAtomic) exported in the InterfaceLib shared library. Even these functions may switch to 68K mode if the operands to them are not aligned. In Mac OS 9, the functions listed in Appendix A are preemptive-safe. If you need to access any other system software functions from a preemptive task, you must do so using the MPRemoteCall function.
Introduced with Multiprocessing Services 2.0.
Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.
© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)